import { Command } from "../class/Command";
import { Role } from "../class/Role";
import { MethodFactory } from "../factory/MethodFactory";
import { toSecond } from "../tool";

export class LookMethod extends Command {
    static commandName: string = "查看技能";
    invoke() {
        const methodName = this.context.nextParam();
        const methodSubClass = MethodFactory.getByName(methodName);
        const method = new methodSubClass(null as unknown as Role);
        this.masterRole.message.add(method.getName())
        this.masterRole.message.add(`[技能CD]:${toSecond(method.CD)}`)
        this.masterRole.message.add(`[介绍]:${method.describe}`)
    }
}